package org.ru.mse10.cvis.entity.cv;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.ru.mse10.cvis.entity.misc.AddressDateRange;
import org.ru.mse10.cvis.entity.misc.Identity;

/**
 * The Class WorkExpirience.
 */
@Entity
@Table(name = "work_expirience")
public class WorkExpirience extends Identity {

	/** The date ranges. */
	private Set<AddressDateRange> dateRanges = new HashSet<AddressDateRange>();

	/** The locations. */
	private Set<Address> locations = new HashSet<Address>();

	/** The description. */
	private String description;

	/** The cv data. */
	private CvData cvData;

	/**
	 * Gets the date ranges.
	 * 
	 * @return the date ranges
	 */
	@ManyToMany(cascade = CascadeType.ALL)
	public Set<AddressDateRange> getDateRanges() {
		return dateRanges;
	}

	/**
	 * Sets the date ranges.
	 * 
	 * @param dateRanges
	 *            the new date ranges
	 */
	public void setDateRanges(Set<AddressDateRange> dateRanges) {
		this.dateRanges = dateRanges;
	}

	/**
	 * Gets the locations.
	 * 
	 * @return the locations
	 */
	@ManyToMany(cascade = CascadeType.ALL)
	public Set<Address> getLocations() {
		return locations;
	}

	/**
	 * Sets the locations.
	 * 
	 * @param locations
	 *            the new locations
	 */
	public void setLocations(Set<Address> locations) {
		this.locations = locations;
	}

	/**
	 * Gets the description.
	 * 
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Sets the description.
	 * 
	 * @param description
	 *            the new description
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * Gets the cv data.
	 * 
	 * @return the cv data
	 */
	@ManyToOne
	public CvData getCvData() {
		return cvData;
	}

	/**
	 * Sets the cv data.
	 * 
	 * @param cvData
	 *            the new cv data
	 */
	public void setCvData(CvData cvData) {
		this.cvData = cvData;
	}

}
